package com.jingyanzi.privilege.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.finance.result.ResultSupport;
import com.jingyanzi.privilege.domain.OrgDO;
import com.jingyanzi.privilege.domain.result.ResultDO;
import com.jingyanzi.privilege.service.IOrgService;

@RestController
@RequestMapping("/api")
public class OrgClientImpl  {
	@Autowired
	IOrgService orgService;

	@GetMapping("/org/{id}")
	public OrgDO get(@PathVariable(value = "id") Integer id) {
		ResultDO result  = orgService.get(id);
		return (OrgDO) result.getModel(ResultSupport.FIRST_MODEL_KEY);
	}
	
}